Optimal. Leaf size=90 \[ \frac {2 i d^2 \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {Li}_2\left (e^{i (a+b x)}\right )}{b^3}-\frac {4 d (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \csc (a+b x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4410, 4183, 2279, 2391} \[ \frac {2 i d^2 \text {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^3}-\frac {4 d (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \csc (a+b x)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 4183
Rule 4410
Rubi steps
\begin {align*} \int (c+d x)^2 \cot (a+b x) \csc (a+b x) \, dx &=-\frac {(c+d x)^2 \csc (a+b x)}{b}+\frac {(2 d) \int (c+d x) \csc (a+b x) \, dx}{b}\\ &=-\frac {4 d (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \csc (a+b x)}{b}-\frac {\left (2 d^2\right ) \int \log \left (1-e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (2 d^2\right ) \int \log \left (1+e^{i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac {4 d (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \csc (a+b x)}{b}+\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}-\frac {\left (2 i d^2\right ) \operatorname {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=-\frac {4 d (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \csc (a+b x)}{b}+\frac {2 i d^2 \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^3}-\frac {2 i d^2 \text {Li}_2\left (e^{i (a+b x)}\right )}{b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 2.04, size = 234, normalized size = 2.60 \[ \frac {-2 b^2 \csc (a) (c+d x)^2+b^2 \csc \left (\frac {a}{2}\right ) \sin \left (\frac {b x}{2}\right ) (c+d x)^2 \csc \left (\frac {1}{2} (a+b x)\right )-b^2 \sec \left (\frac {a}{2}\right ) \sin \left (\frac {b x}{2}\right ) (c+d x)^2 \sec \left (\frac {1}{2} (a+b x)\right )-8 b c d \tanh ^{-1}\left (\cos (a)-\sin (a) \tan \left (\frac {b x}{2}\right )\right )+4 d^2 \left (2 \tan ^{-1}(\tan (a)) \tanh ^{-1}\left (\cos (a)-\sin (a) \tan \left (\frac {b x}{2}\right )\right )+\frac {\sec (a) \left (i \text {Li}_2\left (-e^{i \left (b x+\tan ^{-1}(\tan (a))\right )}\right )-i \text {Li}_2\left (e^{i \left (b x+\tan ^{-1}(\tan (a))\right )}\right )+\left (\tan ^{-1}(\tan (a))+b x\right ) \left (\log \left (1-e^{i \left (\tan ^{-1}(\tan (a))+b x\right )}\right )-\log \left (1+e^{i \left (\tan ^{-1}(\tan (a))+b x\right )}\right )\right )\right )}{\sqrt {\sec ^2(a)}}\right )}{2 b^3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 375, normalized size = 4.17 \[ -\frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + i \, d^{2} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) - i \, d^{2} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) + i \, d^{2} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) - i \, d^{2} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + b c d\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + b c d\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) - {\left (b c d - a d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) - {\left (b c d - a d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) - {\left (b d^{2} x + a d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) - {\left (b d^{2} x + a d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right )}{b^{3} \sin \left (b x + a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )}^{2} \cos \left (b x + a\right ) \csc \left (b x + a\right )^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.03, size = 233, normalized size = 2.59 \[ -\frac {d^{2} x^{2}}{b \sin \left (b x +a \right )}+\frac {2 d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}-\frac {2 d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b^{2}}-\frac {2 d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) a}{b^{3}}-\frac {2 i d^{2} \dilog \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 i d^{2} \dilog \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b^{3}}-\frac {2 a \,d^{2} \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b^{3}}-\frac {2 c d x}{b \sin \left (b x +a \right )}+\frac {2 c d \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b^{2}}-\frac {c^{2}}{b \sin \left (b x +a \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.52, size = 556, normalized size = 6.18 \[ \frac {{\left (2 \, b d^{2} x + 2 \, b c d - 2 \, {\left (b d^{2} x + b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (2 i \, b d^{2} x + 2 i \, b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) + {\left (2 \, b c d \cos \left (2 \, b x + 2 \, a\right ) + 2 i \, b c d \sin \left (2 \, b x + 2 \, a\right ) - 2 \, b c d\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) - {\left (2 \, b d^{2} x \cos \left (2 \, b x + 2 \, a\right ) + 2 i \, b d^{2} x \sin \left (2 \, b x + 2 \, a\right ) - 2 \, b d^{2} x\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \cos \left (b x + a\right ) + 2 \, {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) - d^{2}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 2 \, {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) - d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) - {\left (i \, b d^{2} x + i \, b c d + {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left (-i \, b d^{2} x - i \, b c d + {\left (i \, b d^{2} x + i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left (2 i \, b^{2} d^{2} x^{2} + 4 i \, b^{2} c d x + 2 i \, b^{2} c^{2}\right )} \sin \left (b x + a\right )}{-i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + b^{3} \sin \left (2 \, b x + 2 \, a\right ) + i \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\cos \left (a+b\,x\right )\,{\left (c+d\,x\right )}^2}{{\sin \left (a+b\,x\right )}^2} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c + d x\right )^{2} \cos {\left (a + b x \right )} \csc ^{2}{\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________